home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / Border.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  83 lines

  1. /*
  2.  * @(#)Border.java    1.9 97/10/02
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20. package com.sun.java.swing.border;
  21.  
  22. import java.awt.Graphics;
  23. import java.awt.Insets;
  24. import java.awt.Rectangle;
  25. import java.awt.Component;
  26.  
  27. /**
  28.  * Interface describing an object capable of rendering a border
  29.  * around the edges of a swing component.
  30.  * <p>
  31.  * In the Swing component set, borders supercede Insets as the
  32.  * mechanism for creating a (decorated or plain) area around the 
  33.  * edge of a component.
  34.  * <p>
  35.  * Usage Notes:
  36.  * <ul>
  37.  * <li>Use EmptyBorder to create a plain border (this mechanism
  38.  *     replaces its predecessor, <code>setInsets</code>).
  39.  * <li>Use CompoundBorder to nest multiple border objects, creating
  40.  *     a single, combined border.
  41.  * <li>Border instances are designed to be shared. Rather than creating
  42.  *     a new border object using one of border classes, use the
  43.  *     BorderFactory methods, which produces a shared instance of the
  44.  *     common border types.
  45.  * <li>Additional border styles include BevelBorder, SoftBevelBorder,
  46.  *     EtchedBorder, LineBorder, TitledBorder, and MatBorder.
  47.  * <li>To create a new border class, subclass AbstractBorder.   
  48.  * </ul>
  49.  * 
  50.  * @version 1.9 10/02/97
  51.  * @author David Kloba
  52.  * @author Amy Fowler
  53.  * @see EmptyBorder
  54.  * @see CompoundBorder
  55.  */
  56. public interface Border
  57. {
  58.     /**
  59.      * Paints the border for the specified component with the specified 
  60.      * position and size.
  61.      * @param c the component for which this border is being painted
  62.      * @param g the paint graphics
  63.      * @param x the x position of the painted border
  64.      * @param y the y position of the painted border
  65.      * @param width the width of the painted border
  66.      * @param height the height of the painted border
  67.      */
  68.     void paintBorder(Component c, Graphics g, int x, int y, int width, int height);
  69.  
  70.     /**
  71.      * Returns the insets of the border.  
  72.      * @param c the component for which this border insets value applies
  73.      */
  74.     Insets getBorderInsets(Component c);
  75.  
  76.     /**
  77.      * Returns whether or not the border is opaque.  If the border
  78.      * is opaque, it is responsible for filling in it's own
  79.      * background when painting.
  80.      */
  81.     boolean isBorderOpaque();
  82. }
  83.